#pragma once
#include "Vectors.h"
#include "EngineResources.h"
#include "../Engine/Networking/bytebuffer.h"

//#ifndef BYTEBUFFER
//#define BYTEBUFFER
//class ByteBuffer;
//#endif

class BaseObject
{
protected:
	/** Private Members */
	Vector3D m_v3Pos;
	Vector3D m_v3Rot;
	Vector3D m_v3Scale;

public:
	/** Public Members */
	e_objectType objectType;
	Vector2D assetIndex;	// asset is a 2d Vector because it needs to know both what list and where in the list it's in
	Vector3D getPos(){return m_v3Pos;}
	bool active;


	BaseObject();
	BaseObject(float x, float y, float z);
	BaseObject(Vector3D position, Vector3D rotation, Vector3D scale);
	BaseObject(float x, float y);

	inline Vector3D const & getPos() const { return m_v3Pos; } const
	Vector3D getRotation() { return m_v3Rot; }
	Vector3D getScale()    { return m_v3Scale; }

	void SetPos(Vector3D a_vnewPos) {m_v3Pos = a_vnewPos;}
	void SetPos(float x, float y, float z) {m_v3Pos.x = x; m_v3Pos.y = y; m_v3Pos.z = z;}
	void Move(float x, float y, float z) { m_v3Pos.x += x; m_v3Pos.y += y; m_v3Pos.z += z;}
	void setRotation(Vector3D a_vnewRot) {m_v3Rot = a_vnewRot;}
	void setRotation(float x, float y, float z) { m_v3Rot.x=x; m_v3Rot.y=y; m_v3Rot.z=z; }
	void setScale(Vector3D a_vnewScale) {m_v3Scale = a_vnewScale;}
	void setScale(float x, float y, float z) {m_v3Scale.x=x; m_v3Scale.y=y;m_v3Scale.z=z;}

	void set(BaseObject b);

	void serialize(ByteBuffer* & info);
	void deserialize(ByteBuffer* info, int & index);
};